<!--
 * @Descripttion : 
 * @Autor        : Lilong
 * @Date         : 2022-09-14 11:01:36
 * @LastEditTime : 2022-09-14 12:08:17
 * @FilePath     : \src\ChildComponent.vue
-->
<template>
    <div>
        <h2>子组件</h2>
        <button @click="handleClick">获取值</button>
    </div>
</template>

<script>
export default {
    name:'ChildComponent',
    data(){
      return { msg: "这是发给父组件的信息" }
    },
    methods: {
        handleClick(){
            this.$emit("sendMsg",this.msg)
        }
    }
}
</script>

<style>

</style>template